<?php

include("../lib.php");

$CON = new DBCON;

$CON->Load();

// connect to mysql

    $sqlservr_con = mysql_connect('127.0.0.1', 'root', 'gbifims');
    if (!$sqlservr_con) {
        die('db server unavailable.');    // . mysql_error());
    }
    $sql_con = mysql_select_db('gbif_ims', $sqlservr_con);
    if (!$sql_con) {
        die ('db unavailable.');    // . mysql_error());
    }

if( $_GET["user_id"])
{
	$user_id = strip_tags($_GET["user_id"]);
	
	file_put_contents  ( "param.txt", $user_id);
/// Build the SQL
	
 $db_query = sprintf("UPDATE users SET deleted = true WHERE user_id = '".$user_id."'");
 
 file_put_contents  ( "delete_statement.txt", $db_query);   
 
 $result = mysql_query($db_query);
    if (!$result) {
        die('invalid query');    // . mysql_error());
    }
}

mysql_free_result( $result )

?>